package com.jysz.certificate.web.action.system;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jysz.certificate.action.AbstractBaseAction;
import com.jysz.certificate.constant.OperCodeConstant;
import com.jysz.certificate.persistence.enums.OrganizationEnum;
import com.jysz.certificate.persistence.enums.RegionEnum;
import com.jysz.certificate.persistence.model.system.Brand;
import com.jysz.certificate.persistence.model.system.Organization;
import com.jysz.certificate.persistence.model.system.Region;
import com.jysz.certificate.persistence.model.system.Shop;
import com.jysz.certificate.service.system.BrandService;
import com.jysz.certificate.service.system.OrganizationService;
import com.jysz.certificate.service.system.RegionService;
import com.jysz.certificate.service.system.ShopService;
import com.jysz.certificate.utils.CommonUtil;
import com.jysz.certificate.web.action.Excel.ExcelSheetParser;
import com.jysz.webcore.ssh.annotation.PermissionPoint;

@Controller
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Namespace("/system/shop")
public class ShopAction  extends AbstractBaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private File fileURL;
	private Shop search;
	private Shop shop;
	private String brandId;
	private String branfName;
	private List<Brand> listBrand;
	private String province;
	private Brand brand;
	private List<Long> cked = new ArrayList<Long>();//选中
	private String city;
	private List<Organization> domainshopList;
	private Long id;
	private List<Region> provinces;
	
	@Resource
	private ShopService shopService;
	@Resource
	private BrandService brandService;
	@Resource
	private OrganizationService organizationService;
	@Resource
	private RegionService regionService;
	
	public void OrgDomaimList(){
		domainshopList=organizationService.DomainList();
	}

	@Action("shopInsertAction")
	public String shopInsertAction(){
//		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		boolean masg = true;
		Brand brand = null;
		Set<Brand> list = new HashSet<Brand>();
		if(StringUtils.isNotBlank(brandId)){
			String[] bId = brandId.split(",");
			
			for(int i=0; i<bId.length;i++){
				Long idLong =  Long.parseLong(bId[i]);
				brand = new Brand();
				brand.setId(idLong);
				list.add(brand);
			}
		}
		search.setBrands(list);
//		search.setToDelete(1);
		/*if(province!=null){
			search.setProvince(province);
		}
		if(city!=null){
			search.setCity(city);
		}*/
		if(StringUtils.isNotBlank(province)){
			Region p=regionService.find(Long.valueOf(province));
			search.setProvince(p.getName());
		}
		
		if(StringUtils.isNotBlank(city)){
			Region c=regionService.find(Long.valueOf(city));
			search.setCity(c.getName());
		}
		
		Shop shop =new Shop();
		if(search.getId()!= null ){
			shop = shopService.get(search.getId());
		}
		if(search.getId()!= null){
			if(shop.getArea() == null && search.getArea() != null && StringUtils.isNotBlank(search.getArea().getName())){//该店原本不存在组织架构上，  && StringUtils.isNotBlank(search.getArea().getName())
				Organization organiqAction =organizationService.organizationKey(search.getArea().getName(),OrganizationEnum.ORG);//需要变更的数据
				if(null != organiqAction){
					Organization organiz =new Organization();
					   organiz.setObjectId(shop.getId());
					   organiz.setParent(organiqAction);
					   organiz.setName(shop.getShopName());
					   organiz.setType(OrganizationEnum.SHOP);
					   int maxOrder = organizationService.getMaxOrder(organiqAction.getId());
					   organiz.setOrder(maxOrder + 1);
					   organiz.setCode(organizationService.genCode(organiqAction, maxOrder));
					   organiz.setGrade(organiqAction.getGrade()+1);
					   organiqAction.getChilds().add(organiz);
					   organizationService.save(organiqAction);
					   shop.setArea(organiqAction);
//					   shopService.saveShop(shop);
				}
				masg = false;
			}else if(shop.getArea() != null && search.getArea() != null && StringUtils.isNotBlank(search.getArea().getName())&&!shop.getArea().getName().equals(search.getArea().getName())){//需要变更组织架构
				Organization qgnt =organizationService.organizationShopKey(shop.getId(), OrganizationEnum.SHOP);
				if( null != qgnt&& qgnt.getChilds().size() >0){
					setSuccessPopMessage("无法更新，该店在组织架构上还有监管人员");
					return SHOW_MSG_PAGE;
				}
				if(null != qgnt){
					organizationService.destory(qgnt);
				}
				Organization organiqAction =organizationService.organizationKey(search.getArea().getName(),OrganizationEnum.ORG);//需要变更的数据
				if(null != organiqAction){
					Organization organiz =new Organization();
					   organiz.setObjectId(shop.getId());
					   organiz.setParent(organiqAction);
					   organiz.setName(shop.getShopName());
					   organiz.setType(OrganizationEnum.SHOP);
					   int maxOrder = organizationService.getMaxOrder(organiqAction.getId());
					   organiz.setOrder(maxOrder + 1);
					   organiz.setCode(organizationService.genCode(organiqAction, maxOrder));
					   organiz.setGrade(organiqAction.getGrade()+1);
					   organiqAction.getChilds().add(organiz);
					   organizationService.save(organiqAction);
					   shop.setArea(organiqAction);
//					   shopService.saveShop(shop);
				}
				masg = false;
			}else if(shop.getArea() != null  && !StringUtils.isNotBlank(search.getArea().getName())){//需要删除的组织架构
				Organization qgnt =organizationService.organizationShopKey(shop.getId(), OrganizationEnum.SHOP);
				if(null != qgnt){
					organizationService.destory(qgnt);
				}
				masg = false;
			}else{
				masg = false;
			}
			if(!shop.getShopName().equals(search.getShopName())){//当4S店名字改变的时候更新组织架构
				Organization qgnt =organizationService.organizationShopKey(shop.getId(), OrganizationEnum.SHOP);
				qgnt.setName(search.getShopName());
				organizationService.save(qgnt);
			}
				
		}
		String ary[]=new String[]{"id","createdAt","creator","area"};
		BeanUtils.copyProperties(search,shop, ary);
		try {
			shopService.saveShop(shop);
			if(masg){
				Organization organization =null;
				if(search.getArea() != null){
					if(search.getArea().getId() ==null && StringUtils.isNotBlank(search.getArea().getName())){
						organization =organizationService.organizationKey(search.getArea().getName(),OrganizationEnum.ORG);
						shop.setArea(null);
					}else{
						shop.setArea(null);
					}
				}
					if(null != organization){
						Organization organiz =new Organization();
						   organiz.setObjectId(shop.getId());
						   organiz.setParent(organization);
						   organiz.setName(shop.getShopName());
						   organiz.setType(OrganizationEnum.SHOP);
						   int maxOrder = organizationService.getMaxOrder(organization.getId());
						   organiz.setOrder(maxOrder + 1);
						   organiz.setCode(organizationService.genCode(organization, maxOrder));
						   organiz.setGrade(organization.getGrade()+1);
						   organization.getChilds().add(organiz);
						   organizationService.save(organization);
						   shop.setArea(organization);
						   shopService.saveShop(shop);
					}
					 
			}
			search=new Shop();
		} catch (Exception e) {
			setFailPopMessage("更新数据失败");
			LOG.error("更新数据失败", e);
			setSuccessPopMessage("更新数据失败");
			return SHOW_MSG_PAGE;
		}
		setSuccessPopMessage("更新数据成功");
		return SHOW_MSG_PAGE;
	}
	/**
	 * 当4S店需要改变区域的是否去判断  该店在组织架构上  下面是否还有驻店人员
	 * @return
	 */
	@Action("judgeOrg")
	public String judgeOrg(){
		Boolean boole= organizationService.judgeOrganization(getId());
		Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
		String msgak= boole.toString();
		this.setJsonText(msgak);
		return JSON_PAGE;
	}
	@Action("selectBrand")
	public String selectBrand(){
		 this.setPage(brandService.findPage(this.getCurrentPage(), this.getPageSize()));
		 setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
			return "selectBrand";
	}
	@Action("DeleteShopAction")
	public String DeleteShopAction(){
		
		Shop shopa=shopService.find(search.getId());
		shopa.setArea(null);
		
		Organization o= new Organization();
		o.setType(OrganizationEnum.SHOP);
		o.setObjectId(search.getId());
		Organization organization = organizationService.organizationId(o);
		if(null != organization){
			organizationService.destory(organization);
		}
		
		
		shopa.setToDelete(0);
		shopa.setBrands(null);
		shopService.save(shopa);
		setSuccessPopMessage("该店禁用成功");
		return SHOW_MSG_PAGE;
	}
	/*
	 * 导入驻店信息
	 */
	@Action("toleada")
	public String toleada(){
		boolean mark = true;
		Map<String,Organization> map = organizationService.DomainMap(OrganizationEnum.ORG);
		Map<String,Organization> shopOrganization = organizationService.DomainMap(OrganizationEnum.SHOP);
		Map<String, Shop> mapShop = shopService.getAllshop();
		Map<String, Brand> mapBrand = brandService.brandMap();
		
		List<Shop> listShops=new ArrayList<Shop>();
		try {
			ExcelSheetParser parser = new ExcelSheetParser(fileURL);
			List<List> datas = parser.getDatasInSheet(0);
			  Shop shopValueShop = null;
			  List listB=datas.get(0);
				 String table="店号,店名,省,市,区域,渠道,销售公司,邮编,地址,本月在库单价,上月结存单价,绩效保底数,保底数递增,独立开票保底数,独立开票递增";
				 String[] ta=table.split(",");
				for(int i=0;i<listB.size();i++){
					if(ta.length+1!=listB.size()){
						this.addActionError("文件不匹配，请确认导入文件是店铺文件\n");
						 mark = false;
						 break;
					}
					if(i!=listB.size()-1){
						String values=String.valueOf(listB.get(i));
						if(!ta[i].equals(values)){
							this.addActionError("第1行，第"+(i+1)+"列,导入文件表头存在错误\n");
							 mark = false;
							   continue;
						}
					}
				}
				if(mark){
			for(int i=1;i<datas.size();i++){//显示数据
				   List row = datas.get(i);
				   String valueString=null;
				   shopValueShop =new Shop();
				   for(int j=0;j<row.size();j++){
					   valueString=String.valueOf(row.get(j));
					   if(j==0 && !valueString.equals("null")){
						   valueString = valueString.toUpperCase();
						   if(valueString.indexOf(".")!=-1){
							   valueString=valueString.substring(0, valueString.indexOf("."));
						   }
						   
						   //检测店号是否唯一
						   if(mapShop.containsKey(valueString)){
							   this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列,"+valueString+"店号重复\n");
							   mark = false;
							   continue;
						   }else{
							   for(int p=0;p<listShops.size();p++){
								   Shop shop=listShops.get(p);
									 if(shop.getShopMark()==valueString){
										 this.addActionError("导入文件中 第"+(i+1)+"行，第"+1+"列, "+valueString+"：店号与第"+(p+2)+"行 第1例"+shop.getShopMark()+"  店号重复\n");
										 mark = false;
										   continue;
									 }
								 }
						   }
						   shopValueShop.setShopMark(valueString);
					   }else  if(j==1 &&!valueString.equals("null")){
						   if(shopOrganization.containsKey(valueString)){
							   this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列,"+valueString+"  4s店已存在组织架构中，不可以重复添加\n");
							   mark = false;
							   continue;
						   }else{
							   shopValueShop.setShopName(valueString);
						   }
						   
					   }else  if(j==2&& !valueString.equals("null")){
						   shopValueShop.setProvince(valueString);
					   }else if(j==3&& !valueString.equals("null")){
						   shopValueShop.setCity(valueString);
					   }else if(j==4 ){
						   if(valueString.equals("null") || valueString == null){
							   shopValueShop.setArea(null);
						   }else{
							   if(map.containsKey(valueString)){
								   shopValueShop.setArea(map.get(valueString));
							    }else{
								   this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列,"+valueString+"：区域不存在系统中，请到组织架构添加，或者确认文件中区域是否输入正确\n");
								   mark = false;
								   continue; 
							    }  
						   }
						   			
						  
					   } else  if(j==5){
						   Set<Brand> list = new HashSet<Brand>();
						   Brand br= null;
						   if(!valueString.equals("null")){
							   String name[] =valueString.split("/");
							   for(int q=0;q<name.length;q++){
								   br=null;
								   if(mapBrand.containsKey(name[q])){
									   br= mapBrand.get(name[q]);
									   if(q == 0){
										   shopValueShop.setDefaultBrand(br);//设置默认渠道
									   }
									   list.add(br);
								   }else{
									   this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列,"+valueString+"：渠道不在系统中，如果存在多个请/符号隔开\n");
									   mark = false;
									   continue;
								   }
								   
								}
								   shopValueShop.setBrands(list);
						   }
						   
					   }else if(j==6 && !valueString.equals("null")){
							   shopValueShop.setCompany(valueString);
						   
					   }else if(j==7){
						   if(valueString.indexOf(".")!=-1){
							   valueString=valueString.substring(0, valueString.indexOf("."));
						   }
						 
						   shopValueShop.setPostcode(valueString);
					   }else if(j==8){
						   if(!valueString.equals("null"))
							   shopValueShop.setAddress(valueString);
					   }else if(j==9){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyStock(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 本月在库单价： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyStock(0D);
								}
						  
					   }else if(j==10){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyRemain(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 上月结存单价： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyRemain(0D);
								}
					   } else if(j==11){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyRoyaltyTiny(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 绩效保底数： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyRoyaltyTiny(0D);
								}
					   } else if(j==12){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyRoyaltyAdding(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 保底数递增： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyRoyaltyAdding(0D);
								}
					   } else if(j==13){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyIndTiny(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 独立开票保底数： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyIndTiny(0D);
								}
					   } else if(j==14){
						   if(!valueString.equals("null")){
								try {
									 double dou=Double.valueOf(valueString).doubleValue();
									 shopValueShop.setMoneyIndBig(dou);
								} catch (Exception e) {
									 this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列, 独立开票递增： "+valueString+"       数据错误\n");
									 mark = false;
									   continue;
								}
								}else{
									shopValueShop.setMoneyIndBig(0D);
								}
					   }  else if((j+1)!=row.size()&&j<15){
						   this.addActionError("第"+(i+1)+"行，第"+(j+1)+"列,数据错误或者不能为空\n");
						   mark = false;
						   continue;
					   }
				   }
				   if(mark){
					   listShops.add(shopValueShop);
				   }
				   
			}	
		}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.out.println("文件没找到 : " + e);  
		} catch (IOException e) {
			e.printStackTrace();
			this.addActionError("文件不匹配, 请确认导入文件是合格证导入文件\n");
			 mark = false;
		}
		if(mark ==false){
			return "tolead";
		}
        
		for(int i=0;i<listShops.size();i++){
			Shop shop=listShops.get(i);
			shop.setToDelete(1);
			shopService.save(shop);
			//添加组织架构数据a
				   if(map.containsKey(shop.getArea().getName())){
					   Organization organization = map.get(shop.getArea().getName());
					   Organization organiz =new Organization();
					   organiz.setObjectId(shop.getId());
					   organiz.setParent(organization);
					   organiz.setName(shop.getShopName());
					   organiz.setType(OrganizationEnum.SHOP);
					   
					   int maxOrder = organizationService.getMaxOrder(organization.getId());
					   organiz.setOrder(maxOrder + 1);
					   organiz.setCode(organizationService.genCode(organization, maxOrder));
					   organiz.setGrade(organization.getGrade()+1);
					   organization.getChilds().add(organiz);
					   organizationService.save(organization);
					   
				   }
			 
			
			
		}
		setSuccessPopMessage("导入数据成功");
		return SHOW_MSG_PAGE;
		
	}
	@PermissionPoint(point=OperCodeConstant.SYS_SHOP_IMPORT)
	@Action("tolead")//导入页面**驻店
	public String tolead() {
		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		return "tolead";
	}
	@Action("add")//新增页面**驻店
	public String add() {
		listBrand=brandService.seleteAll();
		provinces=regionService.findByType(RegionEnum.PROVINCE);
		this.OrgDomaimList();
		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		return "add";
	}
	@Action("brandAll")
	public String brandAll(){
		if(StringUtils.isNotBlank(brandId)){
			String[] ck = brandId.split(",");
			for(int i=0;i<ck.length;i++){
				cked.add(new Long(ck[i]));
			}
		}
		listBrand=brandService.seleteAll();
		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		return "selectBrand";
	}
	@Action(INDEX)//查询页面**驻店所有
	public String index() {
		this.OrgDomaimList();
		if(StringUtils.isNotBlank(province)){
			Region p=regionService.find(Long.valueOf(province));
			shop.setProvince(p.getName());
		}
		
		if(StringUtils.isNotBlank(city)){
			Region c=regionService.find(Long.valueOf(city));
			shop.setCity(c.getName());
		}
		provinces=regionService.findByType(RegionEnum.PROVINCE);
		listBrand = brandService.findAll();
		this.setPage(shopService.selectUser(null ,shop, brand,getCurrentPage(), this.getPageSize()));
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(), "shop", shop);
		return INDEX;
	}
	
	@Action("select")//查询页面**驻店-条件
	public String select() {
		this.OrgDomaimList();
		if(StringUtils.isNotBlank(province)){
			search.setProvince(province);
		}
		if(StringUtils.isNotBlank(city)){
			search.setCity(city);
		}
		this.setPage(shopService.selectUser(null ,shop,brand, getCurrentPage(), this.getPageSize()));
		setRedirectUrl("index.do?currentPage=" + getCurrentPage(), "shop",shop);
		return INDEX;
	}
	@Action("minute")//查询页面**驻店-id
	public String minute() {
		provinces=regionService.findByType(RegionEnum.PROVINCE);
		listBrand = brandService.seleteAll();
		search = shopService.minuteShop(search.getId());
		if(CommonUtil.isNotEmpty(search.getProvince())){
			Region p=regionService.findByName(search.getProvince());
			if(p!=null)
				province = p.getId().toString() ;
		}
		if(CommonUtil.isNotEmpty(search.getCity())){
			Region c=regionService.findByName(search.getCity());
			if(c!=null)
				city = c.getId().toString() ;
		}
		
		this.OrgDomaimList();
		Iterator ite= search.getBrands().iterator();
		while (ite.hasNext()) {
			Brand brandf =(Brand)ite.next();
			branfName = brandf.getName()+","+branfName;
			brandId = brandf.getId()+","+brandId;
		}
		if(StringUtils.isNotBlank(branfName) && StringUtils.isNotBlank(brandId)){
			branfName = branfName.substring(0, branfName.indexOf(",null"));
			brandId = brandId.substring(0, brandId.indexOf(",null"));
		}
		
		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		return UPDATE;
	}
	@Action("details")//查询页面**驻店-id
	public String details() {
		search=shopService.minuteShop(search.getId());
		this.OrgDomaimList();
		Iterator ite= search.getBrands().iterator();
		while (ite.hasNext()) {
			Brand brandf =(Brand)ite.next();
			branfName = brandf.getName()+","+branfName;
			brandId = brandf.getId()+","+brandId;
		}
		if(StringUtils.isNotBlank(branfName)){
		branfName = branfName.substring(0, branfName.indexOf(",null"));
		}
		setRedirectUrl("index.do?currentPage="+getCurrentPage(),"shop",shop);
		return "details";
	}
	@Action("detailsBrand")//查询默认渠道
	public String detailsBrand() {
		String[] bId = brandId.split(",");
		Long[] brandids=new Long[bId.length];
		for(int i=0 ;i<bId.length;i++){
			brandids[i] = Long.parseLong(bId[i])  ;
		}
		List<Brand> brands = brandService.detailsBrand(brandids);
		List list =new ArrayList();
		String text = "";
		if(null != brands){
			if(brands !=null && brands.size()>0){
				for(Brand brand : brands){
					if(text.indexOf(brand.getName())==-1){
						String texta=brand.getId()+":"+brand.getName();
						text+=brand.getId()+":"+brand.getName();
						list.add(texta);
					}
				}
			}
			if(list.size()>0){
				Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
				this.setJsonText(gson.toJson(list));
			}else{
				Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
				this.setJsonText(gson.toJson(null));
			}
			
		}
		return JSON_PAGE;
	}
	
	public Shop getSearch() {
		return search;
	}
	public List<Brand> getListBrand() {
		return listBrand;
	}
	public void setListBrand(List<Brand> listBrand) {
		this.listBrand = listBrand;
	}
	public void setSearch(Shop search) {
		this.search = search;
	}
	public List<Long> getCked() {
		return cked;
	}
	public void setCked(List<Long> cked) {
		this.cked = cked;
	}
	
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public Shop getShop() {
		return shop;
	}
	public void setShop(Shop shop) {
		this.shop = shop;
	}

	public String getBrandId() {
		return brandId;
	}
	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}
	public File getFileURL() {
		return fileURL;
	}
	public void setFileURL(File fileURL) {
		this.fileURL = fileURL;
	}

	public String getBranfName() {
		return branfName;
	}
	public void setBranfName(String branfName) {
		this.branfName = branfName;
	}
	public Brand getBrand() {
		return brand;
	}
	public void setBrand(Brand brand) {
		this.brand = brand;
	}

	public List<Organization> getDomainshopList() {
		return domainshopList;
	}

	public void setDomainshopList(List<Organization> domainshopList) {
		this.domainshopList = domainshopList;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public List<Region> getProvinces() {
		return provinces;
	}

	public void setProvinces(List<Region> provinces) {
		this.provinces = provinces;
	}
	
}
